package com.blockchainenergy.info.line.impl;

import com.blockchainenergy.info.line.Line;
import com.blockchainenergy.info.line.LineService;
import com.blockchainenergy.info.line.dao.LineDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @descriptions:
 * @data: 2021/10/23 12:40
 */
@Service
@Transactional
public class LineServiceImpl implements LineService {
    @Resource
    private LineDao lineDao;

    private final static Integer NUMS_OF_NODES = 33;

    @Override
    public List<Line> getLines() throws Exception {
        List<Line> nodeLines = new ArrayList<>();
        for (int i = 0; i < NUMS_OF_NODES; i++) {
            nodeLines.add(new Line(i, i + 1));
        }
        return nodeLines;
    }
}
